﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated with http://xmltocs.com/ */
namespace EDMXParserV1
{
    public class Principal
    {
        public Principal()
        {
            PropertyRefs = new List<PropertyRef>();
        }

        public String Role { get; set; }
        public List<PropertyRef> PropertyRefs { get; set; }


        public static Principal New(System.Xml.XmlNode Node)
        {
            Principal Principal = new Principal();
            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "Role":
                        Principal.Role = Attribute.Value;
                        break;

                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }
            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "PropertyRef":
                        PropertyRef PropertyRef = PropertyRef.New(ChildNode);
                        Principal.PropertyRefs.Add(PropertyRef);
                        break;
                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return Principal;

        }
    }
}
